package Java继承;

public class Teacher2 extends Person {
    private String title;

    public Teacher2(String id, String name, String title) {
        super(id, name);
        this.title = title;
    }

    @Override
    public void showInfo() {
        super.showInfo();
        System.out.println("，身份：教师，职称：" + title);
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
}